/*
 * @Description:
 * @Version: 2.0
 * @Autor: zss
 * @Date: 2024-03-18 16:49:12
 * @LastEditors: swc
 * @LastEditTime: 2024-08-29 11:42:48
 */
import { T_srv, Tsrv, ifs, ts, tvs, vue } from '@/services';
import { N_oBaseGrid } from '@/types';
import { I_cmd, T_cmd } from './command';
import { N_BaseSet } from './types';

const columns0 = () => [
  {
    title: 'FieldName',
    slot: 'FieldName',
    key: 'FieldName', // 设置单元格样式时，iview通过key定位
    editComp: {
      type: 'input'
    }
  },
  {
    title: 'DataType',
    slot: 'DataType',
    key: 'DataType',
    editComp: {
      type: 'input'
    }
  },
  {
    title: 'DefValue',
    slot: 'DefValue',
    key: 'DefValue',
    editComp: {
      type: 'input'
    }
  },
  {
    title: 'NotNull',
    slot: 'NotNull',
    key: 'NotNull',
    editComp: {
      type: 'switch'
    }
  },
  {
    title: 'Comment',
    slot: 'Comment',
    key: 'Comment',
    editComp: {
      type: 'input'
    }
  }
];

const columns1 = () => [
  {
    title: 'DbType',
    slot: 'dbType',
    key: 'dbType',
    editComp: {
      type: 'input'
    }
  },
  {
    title: 'DbName',
    slot: 'dbName',
    key: 'dbName',
    editComp: {
      type: 'input'
    }
  }
];

const custCacheColumns = () => [
  {
    title: 'Field1',
    slot: 'field1',
    key: 'field1',
    editComp: {
      type: 'input'
    }
  },
  {
    title: 'Field2',
    slot: 'field2',
    key: 'field2',
    editComp: {
      type: 'input'
    }
  },
  {
    title: 'Field3',
    slot: 'field3',
    key: 'field3',
    editComp: {
      type: 'input'
    }
  },
  {
    title: 'Field4',
    slot: 'field4',
    key: 'field4',
    editComp: {
      type: 'input'
    }
  }
];
const columns2 = () => [
  {
    title: 'Field1',
    slot: 'field1',
    key: 'field1',
    editComp: {
      type: 'input'
    }
  },
  {
    title: 'Field2',
    slot: 'field2',
    key: 'field2',
    editComp: {
      type: 'input'
    }
  },
  {
    title: 'Field3',
    slot: 'field3',
    key: 'field3',
    editComp: {
      type: 'input'
    }
  },
  {
    title: 'Field4',
    slot: 'field4',
    key: 'field4',
    editComp: {
      type: 'input'
    }
  }
];

const styleTemplateColumns = () => [
  {
    // title: 'TemplateName',
    title: Tsrv.getI18nByValue('模板名'),
    key: 'templateName',
    align: 'center'
  },
  {
    title: Tsrv.getI18nBySrv('用户ID'),
    slot: 'userID',
    align: 'center'
  },
  {
    title: Tsrv.getI18nByValue('UIID'),
    slot: 'uiId',
    align: 'center'
  },
  {
    title: Tsrv.getI18nByValue('行为ID'),
    slot: 'behaviorId',
    align: 'center'
  }
];

const styleTemplateData = () => [
  {
    templateName: Tsrv.getI18nBySrv('系统默认模板'),
    f_comment: 'sysTemplate'
  },
  {
    templateName: Tsrv.getI18nBySrv('用户默认模板'),
    f_comment: 'userTemplate'
  }
];

const fontFamilyData = () => [
  '微软雅黑 Regular, 微软雅黑, sans-serif',
  '楷体 Regular, KaiTi, sans-serif',
  '华文隶书 Regular, LiSu, sans-serif',
  '方正舒体 Regular, FangZhengShuTi, sans - serif',
  '华文行楷 Regular, STXingkai, sans-serif',
  '宋体 Regular, SimSun, sans-serif'
];

const groupCode = () => [
  {
    value: 0,
    label: Tsrv.getI18nBySrv('系统级')
  },
  {
    value: 1,
    label: Tsrv.getI18nBySrv('用户级')
  }
];

type TabPaneName =
  | 'set1'
  | 'SYS_TABLE_DEF_FIELD'
  | 'SYS_VIEW'
  | 'SYS_TABLE'
  | 'SYS_BACKUP_DB_INFO'
  | 'CUST_CACHE_FUNS';

export {
  I_cmd,
  N_BaseSet,
  N_oBaseGrid,
  T_cmd,
  T_srv,
  TabPaneName,
  Tsrv,
  columns0,
  columns1,
  columns2,
  custCacheColumns,
  fontFamilyData,
  groupCode,
  ifs,
  styleTemplateColumns,
  styleTemplateData,
  ts,
  tvs,
  vue
};
